#include <stdio.h>
#include "test_base.hpp"

class MyTest : public Test
{
public:
    MyTest(int v);

    int FunAdd(int a, int b);
    int FunPrint(const char* str);

private:
    int val;
};

MyTest::MyTest(int v)
{
    val = v;
}

int MyTest::FunAdd(int a, int b)
{
    return a + b;
}

int MyTest::FunPrint(const char* str)
{
    printf("val = %d : %s", val, str);
    return 0;
}

//主进程中不能用new和delete来实例化库中的类,这里需用c函数帮忙
extern "C" {

MyTest* test_create(int v)
{
    return new MyTest(v);
}

void test_release(MyTest* t)
{
    delete t;
}

}
